package com.techusn.json.fromat.base.annotation;

import com.fasterxml.jackson.annotation.JacksonAnnotationsInside;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.techusn.json.fromat.base.seriallize.PatternFormatSerialize;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * @author chenYX
 * 对输出json格式化注解
 * @date 2021/8/11 10:49
 * @description
 */
@Target({ElementType.FIELD,ElementType.ANNOTATION_TYPE})
@Retention(RetentionPolicy.RUNTIME)
@JacksonAnnotationsInside
@JsonSerialize(using = PatternFormatSerialize.class,nullsUsing = PatternFormatSerialize.class)
public @interface FormatSerialize {
    /**
     * 该值是用户自己添加的附加信息 如可以传递format规则等
     */
    String[] attach() default {};
    /**
     * 指定的序列化策略key
     */
    String key();

}
